<!DOCTYPE html>
<html lang="en" xmlns:zxw="http://www.w3school.com.cn">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../js/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../../css/common/animate.css"/>
    <link rel="stylesheet" href="../../../css/common/common.css"/>
</head>
<body>
<form class="layui-form" lay-filter="orgf" action="">
    <zxw:select change="selectOrg" parcel="true" parcelName="上级组织" multiple="true" id="supper_id"
                field_name_key="org_name" field_value_key="id" name="supper_id" class="zxw_select" key=""
                url="URL.ORG.LOAD_ORG_LIST?type=1"></zxw:select>
    <zxw:input class="zxw_input" parcel="true" parcelName="组织名称" id="org_name" name="org_name" lay_verify="required"
               placeholder="请输入请输入组织名称"></zxw:input>
</form>
<!--<script src="../../../js/common/jquery/jquery-1.11.1.js" ></script>-->
<script type="application/javascript" src="../../../js/common/own/own.js?layui,jquery,treeview,njzxw,URL">
    njzxw.layui.val({
        url: URL.ORG.MAP_URL,
        gather: ['supper_id']
    });
    njzxw.layui.submit({
        url: URL.ORG.SAVE_URL,
        params: ['supper_id']
    });

    function selectOrg(data) {
        console.log("===:", data);
        if (data.value == njzxw.getQueryParamsString('id')) {
            njzxw.alert({
                error: true,
                msg: '不可选择自己哦'
            });
            njzxw.layui.setVal(data.elem.name, "");
            $('#' + data.elem.name).next().nextAll().remove();
            return false;
        } else {
            return true;
        }
    }

</script>
</body>
</html>